package com.jg.test.Page;

import com.jg.test.AnyTest;
import com.rw.tool.util.json.CastUtil;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

// 技能检定
public class Battle003 extends Page {
    private boolean b;

    @Override
    public void effect() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        Class<?> clazz = AnyTest.team.get(4).getClass();
        Method methodC = clazz.getMethod("skill" + Battle001.choice + "Check");
        b = (Boolean) methodC.invoke(AnyTest.team.get(4));
    }

    @Override
    public void sendMessage() {
        if (b){
            System.out.println("释放成功");
        }else {
            System.out.println("释放失败,请重试");
        }
    }

    @Override
    public void next() {
        if (b){
            AnyTest.pageNavigation.add(new Battle004());
        }else {
            AnyTest.pageNavigation.add(new Battle001());
        }
    }
}
